import request from "@/utils/request";

import {
  Common,
  getWorkloadRequirementListData,
  postReportWorkloadRequirementForm,
  postAuditWorkloadRequirementForm,

} from "./type";

enum AllWorkloadApi {
  GetWorkloadRequirementList = "/item/getWorkloadList",// 获取申报材料需求列表接口
  PutUpdateWorkloadRequirementStatus = "/item/updateWorkloadRequirementStatus",// 更新需求不需要工作量汇报接口
  PostReportWorkloadRequirement = "/item/reportWorkloadRequirement",// 汇报需求工作量接口
  PostAuditWorkloadRequirement = "/item/auditWorkloadRequirement",// 审核需求工作量接口
};

// 获取申报材料需求列表接口
export const GetWorkloadRequirementList = () => request.get<Common<getWorkloadRequirementListData>>(AllWorkloadApi.GetWorkloadRequirementList);

// 更新需求不需要工作量汇报接口
export const PutUpdateWorkloadRequirementStatus = (id: number | null) => request.put<Common<any>>(`${AllWorkloadApi.PutUpdateWorkloadRequirementStatus}?id=${id}`);

// 汇报需求工作量接口
export const PostReportWorkloadRequirement = (data: postReportWorkloadRequirementForm) => request.post<Common<any>>(AllWorkloadApi.PostReportWorkloadRequirement, data);

// 审核需求工作量接口
export const PostAuditWorkloadRequirement = (data: postAuditWorkloadRequirementForm) => request.post<Common<any>>(AllWorkloadApi.PostAuditWorkloadRequirement, data);

